package cn.mayday.designmode.Decorator;

/**
 * @author Mayday05
 * @date 2021/1/4 20:16
 */
public class RedShapeDecorator extends ShapeDecorator {

    public RedShapeDecorator(IShape decoratedShape) {
        super(decoratedShape); // 构造方法设置实现类
    }

    @Override
    public void draw() {
        decoratedShape.draw();
        setRedBorder(decoratedShape); // 扩展行为【关键做的事情】
    }

    private void setRedBorder(IShape decoratedShape) {
        System.out.println("Border Color: Red");
    }


}
